package com.only4play.httpapt.support.bean.posts;

import com.only4play.httpapt.common.json.OpHttpAptGsonBuilder;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * @author liyuncong
 * @version 1.0
 * @file JpPostInfo
 * @brief JpPostInfo
 * @details JpPostInfo
 * @date 2024-08-16
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                     NAME               DESCRIPTION
 * 2024-08-16               liyuncong          Created
 */

@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Builder
public class JpPostInfo implements Serializable {
    private Integer id;
    private Integer userId;
    private String title;
    private String body;

    public static JpPostInfo fromJson(String json) {
        return OpHttpAptGsonBuilder.create().fromJson(json, JpPostInfo.class);
    }
}
